Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified state #78

Draft
wants to merge 25 commits into
base: dev
Choose a base branch
from
Draft

Unified state #78

wants to merge 25 commits into from

Conversation

mpretty-cyro
Copy link
Collaborator

@mpretty-cyro mpretty-cyro commented Feb 2, 2024

The goal of this PR is to consolidate the different config object types behind a single State class so clients only need to hold on to a single object instead of juggling multiple Config objects.

This PR also attempts to abstract as much of the config change/update loop as it currently can via generic hooks (on_send/on_store) and bulk processing methods (state.merge()).

In the future this class can be extended to include individual functions which result in changes across multiple configs in order to simplify the interface for the clients (eg. adding a member to a group).

Cleaned up the send and store hooks
Added a batch merge function
Added the ability to suppress triggering hooks (for use when triggering multiple changes at once)
Added a function to handle the response from sending the 'send' hook data to the swarm
Added code to route the config logging to it's parent state logger (if available and an explicit logger hasn't been set)
Extracted the state C wrapper into it's own file to keep the main logic cleaner
Moved the state-based functions back into their respective cpp files (class was getting too large)
UserGroups & ConvoInfoVolatile C APIs running via the state object
Added a 'load_group_admin_key' function to make the relevant changes needed when getting promoted to admin.
Fixed an issue where failing to handle a '_send' response wasn't setting the state error correctly.
Fixed an issue where the 'prepare_push' wasn't signing group config requests correctly.
Fixed key supplement request verification data
Fixed an issue where functions which triggered the send hook and had their own callbacks weren't reporting send failures correctly
@mpretty-cyro mpretty-cyro changed the title [WIP] Unified state Unified state Feb 28, 2024
@mpretty-cyro mpretty-cyro self-assigned this Feb 28, 2024
@mpretty-cyro mpretty-cyro marked this pull request as ready for review February 28, 2024 21:41
@mpretty-cyro mpretty-cyro marked this pull request as draft July 17, 2024 01:23
@mpretty-cyro
Copy link
Collaborator Author

Converting this back to a draft as it'll require a number of changes to be usable again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants